/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rad.Java.MotelPlus.Class;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import rad.Java.Common.Class.DefaultClass;
import rad.Java.Common.Class.IClass;

/**
 *
 * @author rogerio
 */
public class Price extends DefaultClass implements IClass{
    // <editor-fold defaultstate="collapsed" desc="Declaration of variables">
        private String _name;
        private String _apt_type_id;
        private String _value;
        private String _time;
    // </editor-fold>

    public Price(){
        _gsql.setTable("price");
        _sequence = "price_price_id_seq";
    }

    // <editor-fold defaultstate="collapsed" desc="Declaration of methods Get and Set">
         public String getApt_type_id() {
            return _apt_type_id;
        }

        public void setApt_type_id(String _apt_type_id) {
            this._apt_type_id = _apt_type_id;
        }

        public String getName() {
            return _name;
        }

        public void setName(String _name) {
            this._name = _name;
        }

        public String getTime() {
            return _time;
        }

        public void setTime(String _time) {
            this._time = _time;
        }

        public String getValue() {
            return _value;
        }

        public void setValue(String _value) {
            this._value = _value;
        }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Declaration of functions">
        public void clear() {
            _id                 = "";
            _name               = "";
            _apt_type_id        = "";
            _value              = "";
            _time               = "";
        }

        @Override
        public void get(ResultSet rs) {
            try {
                _id                 = rs.getString("price_id");
                _name               = rs.getString("price_name");
                _apt_type_id        = rs.getString("price_apt_type_id");
                _value              = rs.getString("price_value");
                _time               = rs.getString("price_time");
            } catch (SQLException ex) {
                Logger.getLogger(Price.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        @Override
        public void setGsql() {
            _gsql.setValue( _id              , "price_id");
            _gsql.setValue( _name            , "price_name");
            _gsql.setValue( _apt_type_id     , "price_apt_type_id");
            _gsql.setValue( _value           , "price_value");
            _gsql.setValue( _time            , "price_time");
        }
    // </editor-fold>
}
